package com.xiyu.service.repository.customer.info;

import com.xiyu.service.model.customer.info.CustomerImage;
import com.xiyu.service.model.customer.info.CustomerImageTable;
import org.babyfish.jimmer.spring.repository.JRepository;

import java.util.List;

public interface CustomerImageRepository extends JRepository<CustomerImage, Long> {
    CustomerImageTable customerImageTable = CustomerImageTable.$;

    default void deleteByExcludeId(Long customerId, List<Long> ids){
        sql().createDelete(customerImageTable)
                .where(customerImageTable.customerId().eq(customerId))
                .where(customerImageTable.id().notIn(ids))
                .execute();
    }

    List<CustomerImage> findByCustomerId(Long customerId);


}